package com.asm.mapper;

import com.asm.pojo.Analysis2With3D;
import com.asm.pojo.Gene3D;
import com.asm.pojo.MergedInter;
import org.apache.ibatis.annotations.*;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
@Mapper
public interface Analysis2With3DMapper {
// 根据snvList获取
    List<Analysis2With3D> getDistal(@Param("indexsnvId") String[] indexsnvId,
                                    @Param("files") List<String> files,
                                    @Param("offset") int offset,
                                    @Param("pageSize") int pageSize,
                                    @Param("tissue")String tissue);
    List<Analysis2With3D> getProximal(@Param("indexsnvId") String[] indexsnvId,
                                      @Param("files") List<String> files,
                                      @Param("offset") int offset,
                                      @Param("pageSize") int pageSize,
                                      @Param("tissue")String tissue);
// 根据snv获取
    List<Analysis2With3D> getDistalbysnv(@Param("snv") String snv, @Param("files") List<String> files,@Param("tissue")String tissue);
    List<Analysis2With3D> getProximalbysnv(@Param("snv") String snv, @Param("files") List<String> files,@Param("tissue")String tissue);

//  冗余接口
    List<Analysis2With3D> getSNVByIndex(String[] indexsnvId);
    List<Analysis2With3D> getDistalBySnv(String snvId);
    List<Analysis2With3D> getProximalBySnv(String snvId);

    List<Analysis2With3D> getDistalBySnvList(String[] snvList);
    List<Analysis2With3D> getProximalBySnvList(String[] snvList);
////
//    @Results({
//            @Result(property = "id", column = "id"),
//            @Result(property = "chr", column = "chr"),
//            @Result(property = "anchor1Start", column = "anchor1_start"),
//            @Result(property = "anchor1End", column = "anchor1_end"),
//            @Result(property = "anchor2Start", column = "anchor2_start"),
//            @Result(property = "anchor2End", column = "anchor2_end"),
//            @Result(property = "snv", column = "snv")
//    })
//    @Select("SELECT * FROM merged_inter WHERE snv = #{snv}")
//    List<MergedInter> getMergedInter(String snv);

    // 从distal_index表中获取file值
    List<String> getDistalFileBySnv(@Param("snv") String snv);
    
    // 从proximal_index表中获取file值
    List<String> getProximalFileBySnv(@Param("snv") String snv);

// 得到总数
    int getTotalCount();

    // 从3D_plot_index表中获取file值
    List<String> get3DPlotFileBySnv(@Param("snv") String snv);

    // 根据snv和动态表名查询3D_plot数据
    List<MergedInter> getMergedInterDataBySnv(@Param("tableName") String tableName, @Param("snv") String snv);


//    detail
    List<String> getGene3DTable(String snv);
    List<Gene3D> getGene3D(@Param("snv")String snv,@Param("table")String table);
}
